/******************************************************************************
 * @file       platetableabstractmodel.h
 * @brief      反应版表格数据Model
 *****************************************************************************/
#ifndef PLATETABLEABSTRACTMODEL_H
#define PLATETABLEABSTRACTMODEL_H

#include <QAbstractTableModel>
#include <QQmlParserStatus>
#include <QQmlEngine>
#include <QJsonArray>
#include <QJsonObject>
#include <QJsonValue>

class PlateTableAbstractModel : public QAbstractTableModel, public QQmlParserStatus
{
    Q_OBJECT
    Q_INTERFACES(QQmlParserStatus)
    // Q_PROPERTY(QJsonArray initData READ getInitData WRITE setInitData NOTIFY initDataChanged FINAL)

public:
    explicit PlateTableAbstractModel(QObject *parent = nullptr);
    ~PlateTableAbstractModel();

public:
    // qml类型注册
    static void declareQML();

    // Header:
    QVariant headerData(int section,
                        Qt::Orientation orientation,
                        int role = Qt::DisplayRole) const override; // 获取指定表头

    // Basic functionality:
    int rowCount(const QModelIndex &parent = QModelIndex()) const override; // 获取行数
    int columnCount(const QModelIndex &parent = QModelIndex()) const override; // 获取列数
    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; // 获取指定行列数据
    bool setData(const QModelIndex &index,
                 const QVariant &value,
                 int role = Qt::EditRole) override; // 设置指定索引的数据项的值
    // QQmlParserStatus：构造前
    void classBegin() override;
    // QQmlParserStatus：构造后
    void componentComplete() override;


private:

};

#endif // PLATETABLEABSTRACTMODEL_H
